package com.example.demo.service;

import com.example.demo.entity.UpVoteinfo;
import com.example.demo.mapper.UpvoteMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-04-10
 * Time:20:32
 */
@Service
public class UpvoteService {
    @Autowired
    private UpvoteMapper upvoteMapper;
    public int upvote(UpVoteinfo upVoteinfo) {
        return upvoteMapper.upvote(upVoteinfo);
    }

    public UpVoteinfo haveVote(Integer artid,Integer userid) {
        return upvoteMapper.haveVote(artid,userid);
    }

    public int upvoteState(Integer id,Integer state) {
        return upvoteMapper.upvoteState(id,state);
    }
    public int voteCount(Integer artid) {
        return upvoteMapper.voteCount(artid);
    }
}
